package com.ckk.springcloud.Controller;

import com.ckk.springcloud.service.HystrixService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 陈昆昆
 * @version 1.0
 * @date 2020/6/16 15:21
 */
@RestController
public class HystrixController {
    @Value("server.post")
    private String serverPort;
    @Autowired
    private HystrixService hystrixService;

    @GetMapping("payment/hystrix/getok")
    public String getok(){
        return hystrixService.paymentInfo_OK(1);
    }

    @GetMapping("payment/hystrix/isNotok")
    public String getisnotok()  {
        return hystrixService.paymentInfo_Timeout(2);
    }


}
